<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>05.vue给组件绑定原生事件</title>
</head>
<body>
    <div id="app">
        <child content="hello world" @click.native="handleClick"></child>
    </div>
</body>
<script src="vue.js"></script>
<script>
    Vue.component('child', {
        template: '<div  @click="handleClick">child</div>',
        methods: {
            handleClick() {
                alert('child click');
                this.$emit('click');
            }
        }
    })
    var app = new Vue({
        el: '#app',
        data: {
            content: 'hello world!',
        },
        methods: {
            handleClick: function() {
                alert('hello')
            }
        }
    })
</script>
</html>